home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
8_5.lha
/
8_5
/
fopen.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
467b
|
20 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ Open a named file.
/ The mode can be "r", "w" or "a"
ILE *fopen(const char *file, const char *fmode)
// set the modes up
open_mode m = (*fmode == 'w') ? output :
(*fmode == 'a') ? append :
input;
// open the file
filebuf *st = new filebuf;
st->open((char*)file, m);
return new FILE(st, m);